// $Id: nodemeshpartitiondepth.cpp 72 2004-12-02 15:03:28Z jonas $

#include "nodemeshpartitiondepth.h"

/**
 * Init all members.
 *
 * @param bandwidthUp Upload bandwidth in bytes per timestep (1 time step is in
 *  seconds and can be obtained from Clock::m_secondsPerTimeStep)
 * @param bandwidthDown Download bandwidth in bytes per timestep.
 * @param routingTableSize Number of entries in the routing table.
 * @param fileStoreSize Number of files to fit in the file store.
 * @param requestHopsToLive The HTL to use on requests.
 * @param insertHopsToLive The HTL to use on inserts.
 * @param requestProbability The probability for one node to request a file at
 *  one time step.
 * @param insertProbability The probability for one node to insert a file at
 *  one time step.
 * @param fileHandler A pointer to the file handler to use.
 */
NodeMeshPartitionDepth::NodeMeshPartitionDepth(unsigned int bandwidthUp, unsigned int bandwidthDown, unsigned int routingTableSize, unsigned int fileStoreSize, unsigned int requestHopsToLive, unsigned int insertHopsToLive, float requestProbability, float insertProbability, FileHandler *fileHandler)
	: Node(bandwidthUp, bandwidthDown, routingTableSize, fileStoreSize, requestHopsToLive, insertHopsToLive, requestProbability, insertProbability, fileHandler), NodeMesh(bandwidthUp, bandwidthDown, routingTableSize, fileStoreSize, requestHopsToLive, insertHopsToLive, requestProbability, insertProbability, fileHandler)
{
}

/**
 * Outsource the list ordering to our NodePartitionDepth class.
 *
 * @param file Sort the list with respect to this file.
 * @param list An empty list which will become an ordered list of neighbors.
 */
void NodeMeshPartitionDepth::generateRequestOrderList(File *file, std::list<KeyDistanceHelper> &list)
{
	NodeMesh::generateRequestOrderList(file, list);
	NodePartitionDepth::discriminateRequestOrderList(list);
}
